﻿using Microsoft.Extensions.Configuration;
using MiniFox.Configurations;
using Wechat.MP;

namespace Wechat.MP.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    [Section(ELEMENT_NAME)]
    public class WechatMpServiceConfiguration
    {
        internal const string ELEMENT_NAME = "minifox:wechat:mp.service";

        /// <summary>
        /// 
        /// </summary>
        const string ACCESS_TOKEN_URI = "https://api.weixin.qq.com/cgi-bin/token";
        /// <summary>
        /// 
        /// </summary>
        const int DEFAULT_RENEW_INTERVAL = 3600;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("accessTokenUri")]
        public string AccessTokenUri
        {
            get;
            set;
        } = ACCESS_TOKEN_URI;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("renewInterval")]
        public int RenewInterval
        {
            get;
            set;
        } = DEFAULT_RENEW_INTERVAL;
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName("loggerName")]
        public string LoggerName
        {
            get;
            set;
        }
    }
}
